#include <iostream>
using namespace std;

int f(int n){
	int pre = 1;
	int prePre = 2;
	int result = 0;
	for (int i = 3 ; i <= n ; i++){ //时间复杂度 O(n)
	    result = pre + prePre;
	    pre = prePre;
	    prePre = result;
	}
	return result;
}

int main(){
	cout << "请输入n: ";
	int i = 0;
	cin >> i;
	cout << "result: " << f(i) << endl;
	return 0;
}